/*
 * SINGLETON de un lector de propiedades
 */

package ar.com.remiseria.utils;

import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author mcvalls
 */
public class PropertiesReader {
    
    private static PropertiesReader instance;
    private static Properties applicationMessages;
    
    private PropertiesReader() {
        applicationMessages = new Properties();
        try {
            applicationMessages.load(this.getClass().getResourceAsStream("../resources/applicationMessages.properties"));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
    
    public static PropertiesReader getInstance(){
        if(instance == null){
            instance = new PropertiesReader();
        }
        return instance;
    }
    
    public String getApplicationMessage(String property){
        return applicationMessages.getProperty(property);
    }
}
